﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<ADUSWebApp.Models.Movie>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    创建新电影
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <script src="../../Scripts/MicrosoftAjax.js" type="text/javascript"></script>
    <script src="../../Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script>
    <script src="../../Common/DateTimePicker/datetimepicker_css.js" type="text/javascript"></script>
    <script type="text/javascript">
        function GetFromEndDate() {
            var hdfFromDate = document.getElementById("Content_hdfFromDate");
            hdfFromDate.value = "";
            var regExp = /^$/;
            hdfFromDate.value = document.getElementById("txtCreateDate").value;
        }
    </script>
    <h2>
        创建新电影</h2>
    <%Html.EnableClientValidation(); %>
    <% using (Html.BeginForm())
       {%>
    <%: Html.ValidationSummary(true) %>
    <fieldset>
        <legend>Fields</legend>
        <div class="editor-label">
            <%-- <%: Html.LabelFor(model => model.Title) %>--%>
            片名
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.Title) %>
            <%: Html.ValidationMessageFor(model => model.Title) %>
        </div>
        <div class="editor-label">
            <%--<%: Html.LabelFor(model => model.ReleaseDate) %>--%>
            发布日期
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.ReleaseDate, new { @id = "txtCreateDate" })%>
            <%: Html.ValidationMessageFor(model => model.ReleaseDate) %>
            <img alt="选择时间" src="../../Common/DateTimePicker/cal.gif" onclick="javascript:NewCssCal('txtCreateDate','yyyyMMdd')"
                style="cursor: pointer" />
        </div>
        <div class="editor-label">
            <%--<%: Html.LabelFor(model => model.Genre) %>--%>
            类型
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.Genre) %>
            <%: Html.ValidationMessageFor(model => model.Genre) %>
        </div>
        <div class="editor-label">
            <%-- <%: Html.LabelFor(model => model.Rating) %>--%>
            排名
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.Rating)%>
            <%: Html.ValidationMessageFor(model => model.Rating)%>
        </div>
        <div class="editor-label">
            <%-- <%: Html.LabelFor(model => model.Price) %>--%>
            价格
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.Price) %>
            <%: Html.ValidationMessageFor(model => model.Price) %>
        </div>
        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
    <% } %>
    <div>
        <%: Html.ActionLink("Back to List", "Index") %>
    </div>
</asp:Content>
